//
//  LHCommonViewController.m
//  Knight_Tour
//
//  Created by Bruce_Lin on 15/5/26.
//  Copyright (c) 2015年 TouchOne. All rights reserved.
//

#import "LHCommonViewController.h"
#import "MyNavgationView.h"
#import "LHDetailModel.h"

@interface LHCommonViewController ()

@end
@implementation LHCommonViewController

- (void)dealloc
{
    [_model release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = YES;

    [self setAutomaticallyAdjustsScrollViewInsets:NO];
    
    MyNavgationView *nv = [[MyNavgationView alloc]initWithFrame:CGRectMake(0, 0, LHWidth, 64)];
    [nv creatTitle:_model.titleName];

    nv.leftTarget = self;
    nv.leftAction = @selector(backToUser);
    [nv creatLeftButtonWithImage:@"btn_nav_back"];
    [self.view addSubview:nv];
    [nv release];
    
    UIWebView *web = [[UIWebView alloc]initWithFrame:CGRectMake(0 , 64, LHWidth, LHheight - 64)];
    [self.view addSubview:web];
    [web loadHTMLString:_model.desc baseURL:nil];
    [web release];
}

- (void)backToUser
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
